<%@ page import="com.epta.pojo.User" %>
<%@ page import="com.epta.common.util.MD5Util" %>
<%@ page import="com.epta.shiro.token.manager.TokenManager" %>
<%@ page import="org.apache.shiro.SecurityUtils" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <title>TestShiro</title>
</head>
<body>
    <%
        String pass = MD5Util.MD5EncodeUtf8("123");
        User user = new User();
        user.setName("kgq");
        user.setPassword(pass);
        TokenManager.login(user,false);
    %>
    <%=SecurityUtils.getSubject().isAuthenticated()%>
    <shiro:guest>
        guest<br>
    </shiro:guest>

    <shiro:user>
        user<br>
    </shiro:user>

    <shiro:authenticated>
        authenticated<br>
    </shiro:authenticated>

    <shiro:hasPermission name="/user/delete">
        /user/delete/<br>
    </shiro:hasPermission>

</body>
</html>
